<!-- 图形验证码验证 -->
<template>
<img :src="imgSrc" @click="getCodeImg" alt="" class="pop_imgYzm fr">
</template>

<script>
import { _sendImgCode } from "../axios/index.js";
export default {
data() {
return {
    imgSrc:""
};
},
computed: {},
watch: {
    reset(){
        this.getCodeImg();
    }
},
name:"yzimg",
methods: {
    async getCodeImg() {
      let _self = this;
      const res = await _sendImgCode({responseType: "arraybuffer"});
      let codeImg =  'data:image/png;base64,' + btoa(
          new Uint8Array(res.data).reduce((data, byte) => data + String.fromCharCode(byte), '')
        );
      _self.imgSrc = codeImg;
    }
},
created() {
    this.getCodeImg();
},
mounted() {},
props:["reset"]
}
</script>